<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta http-equiv="Expires" content="0">
    <meta http-equiv="Pragma" content="no-cache">
    <meta http-equiv="Cache-control" content="no-cache">
    <meta http-equiv="Cache" content="no-cache">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
    <title>智能防疫管理</title>
    <link rel="stylesheet" href="./css/weui.min.css">
    <link rel="stylesheet" href="./css/animate.css">
    <link rel="stylesheet" href="./css/index.css">
    <link rel="stylesheet" href="./css/example.css">
</head>
<body>
  <div class="weui-toptips weui-toptips_warn js_tooltips" id='navErrTip'>无法到达，请重新选点</div>
  <div class="weui-toptips weui-toptips_success js_tooltips" id='navOkTip'>路径规划成功</div>
  <div class="weui-toptips weui-toptips_warn js_tooltips" id='selectPosTip'>请在地图中选择终点</div>
    <div id="container" class="container">
    </div>
<script type='text/html' id='tpl_home'>
  <div class="page map mapnav">
    <div class='page__hd'>
        <header>
            <div class="header">
                <!-- <a href="javascript:" data-id='home' id='backtohome' class="back-btn js-item"></a> -->
                <h2>西北三航大厦</h2>
            </div>
        </header>
    </div>
    <div id='fnum_toast' style='display:none'> 
      <div class="weui-mask_transparent"></div>
      <div class="weui-toast">
          <!-- <i class="weui-icon-success-no-circle weui-icon_toast"></i> -->
          <p id='fnumname' class="weui-toast__content">已完成</p>
      </div>
    </div>
    <div class='page__bd' style='height:100%;'>
      <div class='searchBox'> 
          <div class="weui-search-bar">
            <div class="weui-search-bar" id="searchBar">
              <form class="weui-search-bar__form" onkeydown="if(event.keyCode==13) return false;">
                  <div class="weui-search-bar__box">
                      <i class="weui-icon-search"></i>
                      <input type="search" class="weui-search-bar__input" id="searchInput"  placeholder="请输入地点名称"
                            required="">
                      <a href="javascript:clear()" class="weui-icon-clear" id="searchClear"></a>
                  </div>
                  <label class="weui-search-bar__label" id="searchText" onclick="OnsearchText()">
                      <i class="weui-icon-search"></i>
                      <span>请输入地点名称</span>
                  </label>
              </form>
              <a href="javascript:cancel()" class="weui-search-bar__cancel-btn" id="searchCancel">取消</a>
          </div>
          </div>
          <div class='content weui-cells'>
              <!-- <div class='weui-cell'>
                  <div class='weui-cell__bd'>
                    <p>桌子</p>
                  </div>
              </div>
              <div class='weui-cell'>
                <div class='weui-cell__bd'>
                  <p>椅子</p>
                </div>
            </div> -->
          </div>
      </div>
     
        <div id='description'>

        </div>
        <div id='map-container' class="">
        </div> 
        <div class="pannel functions">
         <div class='notify'>
             <svg t="1582790875520" class="icon" viewBox="0 0 1181 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="27574" width="64" height="64"><path d="M1025.732923 514.953846l130.756923 34.973539a33.752615 33.752615 0 0 1 24.733539 37.179077l-0.827077 4.174769a33.792 33.792 0 0 1-41.393231 23.867077l-130.756923-34.973539a33.752615 33.752615 0 0 1-24.733539-37.179077l0.827077-4.174769a33.792 33.792 0 0 1 41.353846-23.867077zM930.146462 4.529231c14.926769 8.585846 20.795077 26.860308 14.296615 42.299077l-1.929846 3.859692-67.623385 116.972308a33.831385 33.831385 0 0 1-42.377846 14.25723l-3.820308-1.929846a33.752615 33.752615 0 0 1-14.296615-42.299077l1.929846-3.820307 67.623385-116.972308a33.831385 33.831385 0 0 1 46.198154-12.366769z m-51.121231 355.012923c87.906462 204.484923 102.478769 411.766154 30.995692 440.910769-92.553846 37.651692-143.399385-130.244923-415.271385-101.809231-39.502769 4.056615-66.678154 29.774769-53.878153 61.282462l4.883692 11.736615c12.8 30.208 38.557538 88.142769 47.222154 107.953231 10.043077 23.000615 45.174154 28.750769 53.720615 48.482462 7.955692 18.235077 1.772308 41.432615-24.221538 51.318153l-113.900308 43.244308c-20.007385 7.601231-47.537231-18.235077-59.707077-46.08l-64.315077-147.692308c-13.745231-31.350154-52.302769-2.048-89.127384-51.515077l-26.939077 8.900924c-6.183385 2.087385-11.815385 4.096-14.769231 5.316923-51.593846 20.913231-122.171077-28.987077-143.753846-79.084308-21.582769-50.176-8.546462-133.947077 43.086769-154.978462C650.24 314.919385 456.231385 77.705846 577.851077 28.238769 649.452308-0.787692 791.000615 154.899692 879.064615 359.581538zM614.518154 143.36l-1.260308 0.275692c-15.911385 6.498462-24.497231 151.788308 43.874462 310.744616 68.332308 159.074462 175.340308 243.278769 191.251692 236.898461 15.911385-6.498462 21.858462-134.419692-46.552615-293.376-65.063385-151.355077-162.855385-250.840615-185.737847-254.424615l-1.575384-0.118154z m525.981538 108.701538a33.752615 33.752615 0 0 1-12.563692 42.771693l-3.741538 2.048-122.683077 57.107692a33.831385 33.831385 0 0 1-32.374154-59.155692l3.741538-2.008616 122.722462-57.107692c16.935385-7.876923 37.021538-0.590769 44.898461 16.305231z" p-id="27575"></path></svg>
         </div>
         <div class='menus'>
          <svg class="icon" aria-hidden="true">
            <use xlink:href="#icon-xitonggongneng"></use>
         </svg> 
      </div>
        </div>
        <div class="pannel map-control">

             <div class="weui-cells">
                 <div class="weui-cell layers-toggle">
                     <div class="layers">
                         <div class="layer-multy">
                             <svg class="icon" aria-hidden="true">
                                 <use xlink:href="#icon-layers"></use>
                              </svg> 
                              <span class="layer-des">多层</span>
                         </div>
                         <div class="layer-single">
                             <svg t="1582769637593" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="18354" width="64" height="64"><path d="M993.622303 209.223676l-460.79999-204.799996a51.199999 51.199999 0 0 0-41.59488 0l-460.79999 204.799996a51.199999 51.199999 0 0 0 0 93.593598l460.79999 204.799996a51.384319 51.384319 0 0 0 41.59488 0l460.79999-204.799996a51.199999 51.199999 0 0 0 0-93.593598z" p-id="18355" data-spm-anchor-id="a313x.7781069.0.i11" class="selected" fill="#1296db"></path><path d="M512.035113 767.999985a51.199999 51.199999 0 0 1-20.7872-4.4032l-460.79999-204.799996a51.210239 51.210239 0 0 1 41.594879-93.593598L512.035113 660.766707l439.992311-195.543036a51.210239 51.210239 0 0 1 41.594879 93.593598l-460.79999 204.799996A51.199999 51.199999 0 0 1 512.035113 767.999985z" p-id="18356" data-spm-anchor-id="a313x.7781069.0.i13" class="" fill="#ffffff"></path><path d="M512.035113 1023.99998a51.199999 51.199999 0 0 1-20.7872-4.4032l-460.79999-204.799996a51.210239 51.210239 0 0 1 41.594879-93.593598L512.035113 916.766702l439.992311-195.543036a51.210239 51.210239 0 0 1 41.594879 93.593598l-460.79999 204.799996A51.199999 51.199999 0 0 1 512.035113 1023.99998z" p-id="18357" data-spm-anchor-id="a313x.7781069.0.i14" class="" fill="#ffffff"></path></svg>
                         <span class="layer-des">单层</span>
                       </div>
                     </div>
                 </div>
                 <div class="weui-cell fnums-toggle">
                 </div>
         
                 <div class="weui-cell map-scale">
                     <div class="map-scale-in">
                         +
                     </div>
                     <div class="map-scale-out">
                         -
                     </div>
                 </div>
                 <div class="weui-cell my-location">
                     <div>
                         <svg class="icon" aria-hidden="true">
                             <use xlink:href="#icon-locate"></use>
                          </svg> 
                     </div>
                 </div>
                 <div class='weui-cell menu' id='mainPanel'>
                  <h5 class='location-info'></h5>
                  <div class='mainActions'>
                    <a class="weui-btn weui-btn_default" id='stopAnimateNav'>停止</a>
                    <a class="weui-btn weui-btn_default" id='startAnimateNav'>
                      模拟导航
                  </a>
                  <a id='startRealNav' class="weui-btn weui-btn_default">
                    开始导航
                  </a>
                  </div>
                </div>
             </div>
        </div>
        <div id='dialogs'>
          <div class="js_dialog" id="iosDialog1" style="display: none;">
            <div class="weui-mask"></div>
            <div class="weui-dialog">
                <div class="weui-dialog__hd"><strong class="weui-dialog__title">功能正在开发中</strong></div>
                <div class="weui-dialog__bd">尊敬的用户，实时定位导航功能正在开发中，期待与您见面</div>
                <div class="weui-dialog__ft">
                    <!-- <a href="javascript:;" class="weui-dialog__btn weui-dialog__btn_default">辅助操作</a> -->
                    <a href="javascript:;" class="weui-dialog__btn weui-dialog__btn_primary" id='realNavClose'>确定</a>
                </div>
            </div>
        </div>
            <div class="js_dialog" id="menu_dialog" style="display: none;">
             <div class="weui-mask"></div>
                 <div id="js_dialog_1" class="weui-half-screen-dialog">
                     <div class="weui-half-screen-dialog__hd">
                       <div class="weui-half-screen-dialog__hd__side">
                         <button class="weui-icon-btn">关闭<i class="weui-icon-close-thin"></i></button>
                       </div>
                       <div class="weui-half-screen-dialog__hd__main">
                         <strong class="weui-half-screen-dialog__title">更多功能</strong>
                       </div>
                     </div>
                     <div class="weui-half-screen-dialog__bd">
                        <a href="javascript:;" class="weui-btn weui-btn_default">
                            园区健康状况查询
                        </a>
                         <a href="javascript:;" class="weui-btn weui-btn_default">
                             联系园区管理处
                         </a>
                     </div>
                 </div>
             </div>
             <div class="js_dialog" id="notify_dialog" style="display: none;">
                <div class="weui-mask"></div>
                    <div id="js_dialog_2" class="weui-half-screen-dialog">
                        <div class="weui-half-screen-dialog__hd">
                          <div class="weui-half-screen-dialog__hd__side">
                            <button class="weui-icon-btn">关闭<i class="weui-icon-close-thin"></i></button>
                          </div>
                          <div class="weui-half-screen-dialog__hd__main">
                            <strong class="weui-half-screen-dialog__title">通知</strong>
                          </div>
                        </div>
                        <div class="weui-half-screen-dialog__bd">
                          <p>
                            <i class="weui-icon-info weui-icon_msg"></i>现已进入疫情访客关键期，为了维护本园区的健康安全，请巡检人员切实做好防疫排查工作！

                            <span class='department'>三航科技大厦管理处 2020年2月28日</span>
                          </p>
                          <p>
                            <i class="weui-icon-info weui-icon_msg"></i>巡检过程中如发现任何可疑情况，请及时拍照、拍视频上传，等待工作人员进行处理。
                            <span class='department'>三航科技大厦管理处 2020年2月28日</span>
                          </p>
                        </div>
                    </div>
                </div>
         </div>
         <div class="weui-mask main"></div>
    </div>
</div>
</script>
    <script src="./lib/jquery.min.js"></script>
    <script src="./lib/wow.min.js"></script>
    <script src="./assets/font_15gqvotzpc/iconfont.js"></script>
    <script src="./assets/font_5t3sf2ll1nv/iconfont.js"></script>
    <script src="./lib/picker.min.js"></script>
    <script src="./lib/pageRoute.js"></script>
    <script src="./lib/esmap-1.6.min.js"></script>
    <script type="text/javascript" src="./lib/zepto.min.js"></script>
    <script type="text/javascript" src="./lib/weui.min.js"></script>
    <script type="text/javascript" src="./lib/jweixin-1.6.0.js"></script>
    <script type="text/javascript" src="./lib/util.js"></script>
    <script type="text/javascript" src="./lib/sz_street.js"></script>
    <script type="text/javascript" src="./lib/xss.min.js"></script>
    <script type="text/javascript">
        var map;
        var picker;
        var stack = [];
        var timeOutEvent=0;
        var navi;
        var myLocationMarker = null;
        var pickedFnum = 1;
        var pickedCoord = null;
        var pickedHeight = 1;
        var addedLocation = false;
        var enablePick = false;
        var inputTimer = null;
        var lastSelect = 0;
        var results = [];
        var myLocation = {
                x:12629990.0572413,
                y:2580072.9431645,
                fnum:3
              }
            $(function(){
              // pageManager.setDefault('mapnav')
                initMap(3);
                enablePick = true;
                new WOW().init();
                bindEvents();
            });
            function bindEvents(){
                var winH = $(window).height();
                var categorySpace = 10;
                $('.js-item').on('click', function(){
                    var id = $(this).data('id');
                    window.pageManager.go(id);
                });
        }
        function showInfo(data) {
                //距终点的距离
                var distance = data.remain;
                //路线提示信息
                var info = navi.naviDescriptions[data.index];
                var f = info[0] + parseInt(data.distanceToNext) + info[2];
                // console.info(f)
                //普通人每分钟走80米。
                var time = distance / 80;
                var m = parseInt(time);
                var s = Math.floor((time % 1) * 60);
                $('#description').html(
                    '<p>距终点：' +
                        distance.toFixed(1) +
                        ' 米</p><p>大约需要：  ' +
                        m +
                        '  分钟   ' +
                        s +
                        '   秒</p><p>路线提示：' +
                        f +
                        ' </p>'
                );
            }
        function initMap(focusFloor){
                  map = new esmap.ESMap({
                        container: $('#map-container')[0], // 渲染dom
                        mapDataSrc: './data', //地图数据位置
                        focusFloor:focusFloor,
                        modelLines:false,
                        mapThemeSrc: './data/themes', //主题数据位置
                    })
                    map.showCompass = true;
                    map.openMapById('50021');
                    map.on('mapClickNode',function(e){
                      var name = e.name || '位置点';
                      if(e.hitCoord){
                        pickedCoord = e.hitCoord
                      }
                      switch(e.nodeType){
                        case esmap.ESNodeType.FLOOR:
                          pickedFnum = e.floor;
                          break;
                        case esmap.ESNodeType.MODEL:
                          pickedHeight = e.RoomHigh;
                          pickedFnum = e.FloorNum;
                          break;
                        case esmap.ESNodeType.LABEL:
                        case esmap.ESNodeType.FACILITY:
                          pickedHeight = e.data_.Height;
                          pickedFnum = e.FloorNum;
                          break;
                      }
                      pickedFnum&&pickedCoord&&addMarkerToMap(map);
                        $('.location-info').text(pickedFnum+'楼    '+name)
                    }) 
                    map.on('loadComplete',function(){
                      map.panorama = true;
                        initFnumPicker();
                        bindMapEvents()
                        createNavi();
                    })
        }
        function addMarkerToMap(){
          if(!enablePick)return;
              var fnums = map.floorNums;
              for (var i = 0; i < fnums.length; i++) {
                  var fl = map.getFloor(fnums[i]);
                  fl.removeLayersByNames('marker'); //删除一个或者多个name的图层。
              }
               var floorLayer = map.getFloor(pickedFnum)
                var layer =floorLayer.getOrCreateLayerByName('marker',esmap.ESLayerType.IMAGE_MARKER);
                var im = new esmap.ESImageMarker({
                  x:pickedCoord.x,
                  y:pickedCoord.y,   
                  url: './assets/icons/location.png',  
                  size: 64,   		
                  spritify:true,		
                  height:1,    		
                  showLevel: 20,  	
                  seeThrough: true,		
                  callback:function(){
                  },
                  id: 2020,   		
                  name: 'myMarker'   	
                });
                layer.addMarker(im)
                floorLayer.addLayer(layer);
                addedLocation = true;
                pickedHeight = 1;
        }
        function clear(){
          $('#searchInput').val('');
          $('.content').html('');
        }
        function sousuo(InputVal){
            // allseller()
            var text = InputVal
              //     $('.weui-cell').each(function () {
              //         var $self = $(this);
              //         var flag = $self.text().search(text);
              //         if (flag > -1) {
              //             $self.css("display", "");
              //         } else {
              //             $self.css("display", "none");
              //         }
              // });	
      }
      function doSearch(value){
        $('.content').html('');
                results = [];
                var timeDelay = 0;
                var queryParams = {
                  nodeType: esmap.ESNodeType.MODEL, //nodeType指定为房间类型
                  keyword: value
              };
                value&&esmap.ESMapUtil.search(map,'all',queryParams , function(e){
                    e.forEach(function(item,index){
                      results.push(item)
                      var str = item.name.replace(value, '<span class="red">' + value + '</span>')
                      var floor = map.getFloor(item.FloorNum)
                      var floorAlias = floor.floorAlias;
                        var temp = `
                              <div class='weui-cell wow fadeInUp' data-index=${index} data-wow-delay='${timeDelay}s'>
                                <div class='weui-cell__bd'>
                                  <p> <span class='floorDes'>${floorAlias}</span>${str}</p>
                                </div>
                            </div>
                        `
                        $('.content').append(temp)
                        timeDelay+=0.3;
                    })
                  })
      }
        function bindMapEvents(){
            $('.layers-toggle').click(function(){
                $('.layer-single').toggle();
                $('.layer-multy').toggle();
                if(map.visibleFloorNums.length!=map.floorNums.length){
                    map.visibleFloorNums = map.floorNums
                }else{
                    map.visibleFloorNums = [map.focusFloorNum]
                }
            })
            $('#searchInput').bind('input propertychange', function() {
              var $self = $(this)
              var  value = $(this).val();
             
              if(inputTimer)clearTimeout(inputTimer);
              inputTimer = setTimeout(function(){
                doSearch(value)
              },1000)
            });
            $('.content').delegate('.weui-cell', 'click', function() {
                var ind = $(this).data('index')
                var target = results[ind]
                if (!target) return;
                lastSelect&&map.changeModelColor({
                    id: lastSelect,
                    color: 0
                })
                lastSelect = target.ID
                map.changeModelColor({
                    id: target.ID,
                    color: '#ffff66'
                })
                pickedFnum = target.FloorNum;
                pickedCoord = target.mapCoord;
                pickedHeight = target.RoomHigh;
                addMarkerToMap();
                // addMarker({
                //     bid: bid,
                //     x: target.mapCoord.x,
                //     y: target.mapCoord.y,
                //     fnum: target.FloorNum,
                //     height: target.height
                // })
                map.visibleFloorNums = [pickedFnum];
                map.focusFloorNum = {
                  fnum:pickedFnum,
                  callback:function(){
                    map.moveTo({
                    x: target.mapCoord.x,
                    y: target.mapCoord.y,
                    callback: function() {
                        map.scaleLevelTo(5)
                    }
                })
                  }
                }
          
            })
            $('.map-scale-in').click(function(){
                map.scaleLevelIn();
            })
            $('.map-scale-out').click(function(){
                map.scaleLevelOut();
            })
            $('.notify').click(function(){
                $('#notify_dialog').fadeIn(200);
                $('#js_dialog_2').addClass('weui-half-screen-dialog_show');
            })
            $('.menus').click(function(){
                $('#menu_dialog').fadeIn(200);
                $('#js_dialog_1').addClass('weui-half-screen-dialog_show');
            })
            $('.weui-icon-btn').click(function(){
              $(this).parents('.js_dialog').fadeOut(200);
              $(this).parents('.weui-half-screen-dialog').removeClass('weui-half-screen-dialog_show');
            })
            $('#dialogs').on('click', '.weui-mask', function(){
                $(this).parents('.js_dialog').fadeOut(200);
                $(this).siblings('.weui-half-screen-dialog').removeClass('weui-half-screen-dialog_show');
            });
            $('#startAnimateNav').click(function(){
              if(!pickedCoord){
                $('#selectPosTip').fadeIn(200);
                setTimeout(function(){
                  $('#selectPosTip').fadeOut(200);
                },2000)
                return;
              }
              navi.setStartPoint({
                      x: myLocation.x,
                      y: myLocation.y,
                      showLevel: 18,
                      fnum: myLocation.fnum,
                      height: 1,
                      size:100,
                      url: './assets/icons/start.png',
                  });
              navi.setEndPoint({
                            x: pickedCoord.x,
                            y: pickedCoord.y,
                            showLevel: 18,
                            fnum: pickedFnum,
                            clip:'circle',
                            height: 1,
                            url: './assets/icons/end.png',
                            size: 100,
                      });
                  navi.drawNaviLine();
                if(navi.outcome){
                  $(this).hide();
                  $('#stopAnimateNav').show();
                  $('#description').fadeIn(3000)
                  navi.simulate();
                }
            })
            $('#stopAnimateNav').click(function(){
              $(this).hide();
              $('#startAnimateNav').show();
              navi.stop();
              navi.clearAll();
              $('#description').hide();
            })
            $('#startRealNav').click(function(){
              $('#iosDialog1').fadeIn(200);
            })
            $('#realNavClose').click(function(){
              $('#iosDialog1').fadeOut(200);
            })
            $('.my-location').click(function(){
              focusToMyLocation(5);
              markMyLocation();
            });
        }
        function createNavi() {
      if (map.naviData.length == 0) {
        console.warn("地图导航数据信息不存在！");
        return;
      }
  
      if (!navi) {
        //初始化导航对象
        navi = new esmap.ESNavigation({
          map: map,
          locationMarkerUrl: './assets/icons/pointer.png',
          locationMarkerSize: 150,
          audioPlay: false,
          followPosition:true,
          followAngle:true,
          tiltAngle:60,
          mode: 1,
          offsetHeight: 1,
          // 设置导航线的样式
          lineStyle: {
            color: '#58a2e4',
            //设置线为导航线样式
            lineType: esmap.ESLineType.ESARROW,
            lineWidth: 6,
            offsetHeight: 0.5,
            smooth: true,
            seeThrough: false,
            noAnimate: false
          }
        });
        navi.on('walking',function(data){
          myLocation.x = data.point.x;
          myLocation.y = data.point.y;
          showInfo(data);
        })
        navi.on('complete',function(){
          $('#description').html('');
          $('#description').fadeOut(200)
        })
        navi.on('checkStatus',function(status){
                    if(!status){
                        $('#navErrTip').fadeIn(200);
                       setTimeout(function(){
                        $('#navErrTip').fadeOut(200);
                       },2000)
                    }else{
                      
                      $('#navOkTip').fadeIn(200);
                       setTimeout(function(){
                        $('#navOkTip').fadeOut(200);
                       },2000)
                    }
                  })
      }
    }
    function markMyLocation(){
      if(!myLocationMarker){
                var floorLayer = map.getFloor(myLocation.fnum)
                var layer = new esmap.ESLayer(esmap.ESLayerType.IMAGE_MARKER);
                myLocationMarker = new esmap.ESImageMarker({
                x:myLocation.x,
                y:myLocation.y,   //如果不添加x和y，则默认坐标在地图中心。
                url: './assets/icons/curlocation.png',  //图片标注的图片地址
                size: 64,   			//图片大小 或者 size:{w:32,h:64},
                spritify:true,			//跟随地图缩放变化大小，默认为true，可选参数
                height:1,    			//距离地面高度
                showLevel: 20,  		//地图缩放等级达到多少时隐藏,可选参数
                seeThrough: true,		//是否可以穿透楼层一直显示,可选参数
                callback:function(){
                  myLocationMarker.alwaysShow();
                  myLocationMarker.jump({
                    times:5
                  });
                },
                //angle:30,  	//如果设置了就是固定marker角度，与地图一起旋转。(size需要重新设置)
                id: 2017,   			//id，可自定义
                name: 'myMarker'   		//name可自定义
                });
                layer.addMarker(myLocationMarker)
                floorLayer.addLayer(layer)
              }else{
                myLocationMarker.visible = true;
                myLocationMarker.moveTo({
                  x:myLocation.x,
                  y:myLocation.y,
                  callback:function(){
                    myLocationMarker.jump({
                    times:5
                  });
                  }
                })
              }
    }
    function focusToMyLocation(level){
      map.focusFloorNum ={ fnum:myLocation.fnum,callback:function(){
              map.moveTo({
                x:myLocation.x,
                y:myLocation.y,
                time:0.5,
                callback:function(){
                  map.scaleLevelTo(level,{
                    time:1
                  })
                }
              });
            }}
            map.visibleFloorNums = [myLocation.fnum];
    }
    function OnsearchText(){
      $('#searchInput').focus();
      $('#searchText').hide();
      $('.searchBox  .weui-search-bar__box').css('opacity',1);
      doSearch('区')
    }
        function initFnumPicker(){
            var selects = [];
            map.floorNums.forEach(function(fnum){
                var floor = map.getFloor(fnum)
                var floorDes = floor.floorAlias
                selects.push({
                    text:floorDes,
                    value:fnum
                })
            })
            var parent = document.getElementsByClassName('fnums-toggle')[0]
              //初始化picker
              picker = new Picker({
                data: [selects],
                selectedIndex: [0],
                title: '请选择楼层',
                parent:parent
            });
            picker.show();
            picker.on('picker.change', function (index, selectedIndex) {
              var fnum = map.floorNums[selectedIndex];
              var floor_ = map.getFloor(fnum)
              var floorDes_ = floor_.floorAlias
                if(map.visibleFloorNums.length != map.floorNums.length){
                    map.focusFloorNum = fnum
                    map.visibleFloorNums = [fnum]
                }else{
                    map.focusFloorNum = fnum
                }
                $('#fnumname').text(floorDes_)
                $('#fnum_toast').fadeIn(100);
                setTimeout(function(){
                  $('#fnum_toast').fadeOut(100)
                },800)
            });
        }
    </script>
</body>
</html>